home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 2
/
Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso
/
Pearls
/
arc
/
XFH
/
src
/
Lib
/
bcpl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-25
|
497b
|
30 lines
/* bcpl.c - ugly BCPL conversion stuff. */
#include <exec/types.h>
#include <dossupport.h>
#include <string.h>
BSTR cstr2b(char *cstr, UBYTE *buf){
register UBYTE len;
*buf = len = strlen(cstr);
strncpy(buf+1,cstr,len);
return (BSTR)( (ULONG)buf >> 2 );
}
char *bstr2c(BSTR bstr, UBYTE *buf){
register UBYTE len;
register char *p;
p = (char *)(bstr << 2);
len = *p++;
strncpy(buf, p, len);
buf[len] = '\0';
return (char *)buf;
}
/* End of bcpl.c */